-
Notifications
You must be signed in to change notification settings - Fork 468
Allow for running in node environment #125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
return new Promise((resolve, reject) => { | ||
const timer = setTimeout(onTimeout, timeout) | ||
const observer = new window.MutationObserver(onMutation) | ||
const MutationObserverConstructor = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left this code because I realised this can be useful if someone loads custom shim of MutationObserver after '@sheerun/mutationobserver-shim'
is already loaded
The failing test is not for my code at all |
Ok, I've made it so the tests run via projects so they run at the same time. I also added back the coverage threshold and we're missing coverage somehow. |
Ok, I think this should be good now 👍 |
yes, it'll be better to merge with 99% coverage and fix it later rather than rebase again soon |
I think we're good. Time is funny. Pretty sure that this is ready to go. Let's just wait for CI. |
I'll push fixed code coverage in a sec |
We're all set :) |
🎉 This PR is included in version 3.11.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This fixes code coverage of #125 by extracting helper functions. There are still few istanbul ignores in code but they are not mine :)
Hello, @sheerun. I see that you have added I would like to read the source code of this package, but it cannot be found on Github or elsewhere. The metadata in npm registry doesn't contain any link to source code. Would you mind publishing source code somewhere to accept possible contributions? |
Contributions should be submitted to the original repository but my fork is available at https://github.com/sheerun/MutationObserver.js |
Ideally original repository would implement compatibility with commonjs so there's no need for a fork |
Do you have an open pull-request, that I can upvote? |
no |
Hey @sheerun, could you please open a pull request on the upstream repository? I think I'd like to move back to that original project rather than rely on a fork long-term. |
sorry but preparing this PR will take considerable amount of time as tests are not working for me on original repository and switching main file to commonjs requires changes in compilation pipeline to preserve backward compatibility, simply I have no time for this. maybe someone can handle it |
Understandable. @just-boris, would you be able to make such a PR? |
Yes, I was about to take care of it. I will post an update when it will actually happen. |
This PR supersedes #119, incorporates all your changes, checks if window.MutationObserver is available and uses it instead of using mock, and takes care of wait-for-dom-change